package com.xtedu.examproject.service;

import com.xtedu.examproject.dao.base.ClassRoomDao;
import com.xtedu.examproject.dao.impl.ClassRoomDaoImpl;
import com.xtedu.examproject.entity.ClassRoom;
import com.xtedu.examproject.entity.TeacherCourse;

import java.util.List;

public class ClassRoomService {
    private ClassRoomDao classRoomDao;

    public ClassRoomService(){
        classRoomDao = new ClassRoomDaoImpl();
    }

    public int insertClassRoom(ClassRoom classRoom) throws Exception{
        return classRoomDao.insert(classRoom);
    }

    public int deleteClassRoom(ClassRoom classRoom) throws Exception{
        return classRoomDao.delete(classRoom);
    }

    public int updateClassRoom(ClassRoom classRoom) throws Exception{
        return classRoomDao.update(classRoom);
    }

    public ClassRoom findClassRoomById(int id) throws Exception{
        return classRoomDao.findById(id);
    }

    public List<ClassRoom> findAllClassRoom() throws Exception {
        return classRoomDao.findAll();
    }

    public List<ClassRoom> findBySubjectId(int subjectId) throws Exception{
    	return classRoomDao.findBySubjectId(subjectId);
    }
}
